<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>demo</title>
    <script src="../node_modules/vue/dist/vue.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
    
    <div id="app">
        <p>{{firstName+lastName}}</p>
        <p>{{fullName}}</p>
    </div>

    <script type="text/javascript">
        // console.log(Vue)
        let app = new Vue({
            el:"#app",
            data:{
                firstName:"张",
                lastName:"三"
            },
            computed:{
                fullName:function(){
                    console.log('fullName'); // 只有当计算变量 变化才会执行
                    return this.firstName+this.lastName
                }
            }

        })
    </script>
</body>
</html>